#include <iostream>
#include <map>
#include <vector>
#include <sstream>
#include <iterator>


std::string to_string(std::vector<int> vec) {
    std::stringstream ss{};
    std::string str;
    copy(vec.begin(), vec.end(), std::ostream_iterator<int>(ss, ","));
    return ss.str();
}

int main() {
    std::map<int, int> myMap;
    myMap.insert({1, 1});

    myMap[1] += 1;
    myMap[2] += 3;

    std::cout << "myMap:" << std::endl;
    for (const auto &[k, v]: myMap) {
        std::cout << "key=" << k << ", val=" << v << "\n";
    }
    std::cout << "=======\n";
    std::map<int, std::vector<int>> myMap2;
    myMap2.insert({1, {1}});

    myMap2[1].push_back(2);
    myMap2[2].push_back(4);

    for (const auto &[k, v]: myMap2) {
        std::cout << "key=" << k << ", val=" << to_string(v) << "\n";
    }
    return 0;
}
